package com.ad_hccm.dao.Appendix;

import com.ad_hccm.domain.Appendix.Exit;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * TODO 退出(脱落)
 */
@Mapper
public interface ExitDao {
    @Insert("insert into fall_off value(#{id}, #{date}, #{reason}, #{poorTherapeuticEffect}, #{unbearable}, #{economicReason}, #{refusalExplanation}, #{lostFollow_up}, #{sex}, #{complications}, #{transfer}, #{ae})")
    public boolean save(Exit domain);

    @Update("update fall_off set date = #{date}, reason = #{reason}, poorTherapeuticEffect = #{poorTherapeuticEffect}, unbearable = #{unbearable}, economicReason = #{economicReason}, refusalExplanation = #{refusalExplanation}, lostFollow_up = #{lostFollow_up}, sex = #{sex}, complications = #{complications}, transfer = #{transfer}, ae = #{ae} where id=#{id}")
    public boolean update(Exit domain);

    @Select("select * from fall_off where id = #{id}")
    public Exit getById(String id);

    @Select("select * from fall_off")
    public List<Exit> getAll();

    @Delete("delete from fall_off where id=#{id}")
    public boolean delete(String id);
}